---
title: PopUpButton and PopupControl generic confirm/alert
summary: Wraps a button click or a chained sequence of messages in client-side confirm()/alert() dialogs before a postback.
status: draft
owner: <owner>
last_reviewed: 2026-08-21
library: SAIF.Presentation.Web.Controls.PopUps.Infragistics111
reference_type: package
operation_id: OP-7
trigger: Hosting page sets Message/Messages and PopupType (and Active for PopupControl).
---

# PopUpButton and PopupControl generic confirm alert

This operation provides two generic, non-domain-specific confirmation mechanisms: `PopUpButton`, a `Button` subclass that wraps its own click in a dialog, and `PopupControl`, a control that chains one or more dialogs and relays the result via postback.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-7 |
| **Trigger** | Hosting page sets `Message`/`Messages` and `PopupType` (and, for `PopupControl`, `Active = True`). |
| **Inputs** | `Message` (`PopUpButton`), `Messages` (`PopupControl`), `PopupType` (`Notify`/`Confirm`) |
| **Outputs** | For `PopUpButton`: postback proceeds or is cancelled. For `PopupControl`: `ConfirmAction(Confirm, EventArgs)` |
| **Primary components** | `PopUpButton.Render`, `PopupControl.Render`, `PopupControl.RaisePostBackEvent` |
| **Entry point** | `SAIF.Presentation.Web.Controls.PopUps.Infragistics111\PopUpButton.vb`, `SAIF.Presentation.Web.Controls.PopUps.Infragistics111\PopupControl.vb` |

## Steps

**`PopUpButton`:**
1. `Render()` adds an `onclick` attribute:
   - `confirm(Message)` wrapped in a `return(...)` (blocks postback on Cancel) if `PopupType = Confirm`.
   - A plain `alert(Message)` (does not block postback) if `PopupType = Notify`.
2. Calls the base `Button.Render()`.

**`PopupControl`:**
1. `Render()` (when `Active`) builds a `RunPopup()` JS function:
   - For `PopupTypes.Confirm`: chains one `confirm()` call per entry in `Messages` — the loop overwrites the result variable unconditionally after each iteration, so effectively only the last dialog's result gates the outcome*.
   - For `PopupTypes.Notify`: a sequence of `alert()` calls.
2. Registers the script via `Page.ClientScript.RegisterStartupScript` and triggers a postback via `Page.ClientScript.GetPostBackEventReference`, carrying `"true"`/`"false"`.
3. `RaisePostBackEvent(eventArgument)` raises `ConfirmAction(CBool(eventArgument), EventArgs.Empty)` back to the hosting page.

## Process flow

The following diagram visualizes both generic confirm/alert paths.

```mermaid
flowchart TD
	subgraph PopUpButton
		PBStart([Button clicked]) --> PBType{PopupType}
		PBType -->|Confirm| PBConfirm[confirm returns via onclick]
		PBType -->|Notify| PBAlert[alert via onclick]
		PBConfirm --> PBOutcome([Postback proceeds/cancels])
		PBAlert --> PBProceed([Postback proceeds])
	end
	subgraph PopupControl
		PCStart([Active = True, Render]) --> PCBuild[Build RunPopup JS chaining confirm/alert calls]
		PCBuild --> PCPost[Trigger postback with true/false]
		PCPost --> PCRaise[RaisePostBackEvent]
		PCRaise --> PCConfirm([ConfirmAction raised])
	end
```

## Failure and edge-case behavior

- `PopupControl`'s chained-`confirm()` loop overwrites its result variable on each iteration, so for multiple messages only the final dialog's outcome is reflected in the raised `ConfirmAction` value*.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)

## Sources
- `SAIF.Presentation.Web.Controls.PopUps.Infragistics111\PopUpButton.vb`
- `SAIF.Presentation.Web.Controls.PopUps.Infragistics111\PopupControl.vb`
